import Vue from 'vue'
const DEV = 'http://localhost:8000'
// const DEV = ''
const PRO = ''
const API = PRO === '' ? DEV : PRO
// const dataPost = 'http://ntocc.gt50.wanway.xin/tc/send?appkey=13762&secret=0417GtdzsW&seq='
const dataPost = '/api/send?appkey=13762&secret=0417GtdzsW&seq='
let api =  {
    dataPost: {
        // 车辆信息
        carInfo (data) {
            return Vue.axios.post(dataPost + '3', data, {
                headers: {'Content-Type': 'application/xml'}
            })
        },
        // 司机信息
        driverInfo (data) {
            return Vue.axios.post(dataPost + '4', data, {
                headers: {'Content-Type': 'application/xml'}
            })
        },
        // 电子运单
        wayBillInfo (data) {
            return Vue.axios.post(dataPost + '1', data, {
                headers: {'Content-Type': 'application/xml'}
            })
        },
        // 资金流水
        priceInfo (data) {
            return Vue.axios.post(dataPost + '2', data, {
                headers: {'Content-Type': 'application/xml'}
            })
        }
    },
    Login: {
        login (data) {
            // return Vue.axios.post('/api/login/login', data)
            return Vue.axios.post(API + '/login/login', data)
            // return Vue.axios.post(API + '/index/index', data)
        },
        getTelCode (data) {
            return Vue.axios.post(API + '/GetTelCode/getTelCode', data)
        },
        passwordForget (data) {
            return Vue.axios.post(API + '/passwordForget/passwordForget', data)
        },
        Register (data) {
            return Vue.axios.post(API + '/register/register', data)
        }
    },
    Car: {
        getCarInfo (data) {
            return Vue.axios.post(API+ '/car/carinfo', data)
        },
        modifyInfo (data) {
            return Vue.axios.post(API + '/car/modifyInfo', {
                id: data.id,
                data: data
            })
        }
    },
    animate (data) {
        return Vue.axios.post('', data)
    }
}
export default api;